import request from "@/utils/request";

//admin权限级别接口
/**
 * 添加mbCaseSample,供Admin使用
 */
export function addMbCaseSample(row) {
  return request({
    url: "/mb_case_samples",
    method: "post",
    data: row
  });
}
/**
 * 查询mbCaseSample分页,供后台使用
 */
export function getMbCaseSampleByPage(pageVo) {
  return request({
    url: "/mb_case_samples/search",
    method: "post",
    data: pageVo
  });
}
/**
 * 根据id主键获取单条记录
 */
export function getMbCaseSample(id) {
  return request({
    url: "/mb_case_samples/" + id
  });
}

/**
 * 根据主键id更新指定行的数据
 */
export function updateMbCaseSampleById(row) {
  return request({
    url: "/mb_case_samples/" + row.id,
    method: "put",
    data: row
  });
}
/**
 * // 根据id主键删除单条记录
 */
export function removeMbCaseSampleById(id) {
  return request({
    url: "/mb_case_samples/" + id,
    method: "delete"
  });
}
//更换顺序
export function switchSort(newId, oldId) {
  return request({
    url: "/mb_case_samples/switch_sort",
    method: "post",
    params: {
      old_id: oldId,
      new_id: newId
    }
  });
}

//保存样本坑位信息
export function saveSampleHoles(sampleId, holes) {
  return request({
    url: "/mb_case_samples/" + sampleId + "/holes",
    method: "put",
    data: holes
  });
}

//查询样本坑位信息
export function getSampleHoles(sampleId) {
  return request({
    url: "/mb_case_samples/" + sampleId + "/holes"
  });
}
